
const options = [
  {
    value: 0,
    label: '自定义'
  },
  {
    value: 1,
    label: '订单'
  },
  {
    value: 2,
    label: '我的预约'
  },
  {
    value: 3,
    label: '邀请有礼'
  },
  {
    value: 4,
    label: '赠送会员'
  },
  {
    value: 5,
    label: '积分兑换'
  },
  {
    value: 6,
    label: '储值'
  },
  {
    value: 7,
    label: '联系客服'
  },
  {
    value: 8,
    label: '领券中心'
  },
  {
    value: 9,
    label: '设置'
  },
  {
    value: 10,
    label: '发票助手'
  },
  {
    value: 11,
    label: '微信会员卡'
  }
]

const rules = {
  value: [
    { required: true, message: '请选择功能', trigger: 'change' }
  ],
  icon: [
    {
      required: true,
      message: '请上传图片',
      trigger: ['blur', 'change']
    }
  ],
  path: [
    {
      required: true,
      message: '请输入自定义路径',
      trigger: ['blur', 'change']
    }
  ],
  entryName: [
    { required: true, message: '请输入入口名称', trigger: 'change' }
  ],
  orderType: [
    { type: 'array', required: true, message: '请至少选择一个订单类型', trigger: 'change' }
  ],
  dumpType: [
    {
      required: true,
      message: '请选择类型',
      trigger: ['blur', 'change']
    }
  ],
  'contactsInfo.address': [
    {
      required: true,
      message: '请输入地址',
      trigger: ['blur', 'change']
    }
  ],
  'contactsInfo.id': [
    {
      required: true,
      message: '请输入企业ID',
      trigger: ['blur', 'change']
    }
  ],
  'dump.type': [
    {
      required: true,
      message: '请选择类型',
      trigger: ['blur', 'change']
    }
  ],
  'dump.insidePage': [
    {
      required: true,
      message: '请选择链接',
      trigger: ['blur', 'change']
    }
  ],
  'dump.url': [
    {
      required: true,
      message: '请输入地址',
      trigger: ['blur', 'change']
    }
  ],
  'dump.appId': [
    {
      required: true,
      message: '请输入appId',
      trigger: ['blur', 'change']
    }
  ],
  'dump.path': [
    {
      required: true,
      message: '请输入',
      trigger: ['blur', 'change']
    }
  ],
  'dump.feature': [
    {
      required: true,
      message: '请选择',
      trigger: ['blur', 'change']
    }
  ],
  'dump.customPath': [
    {
      required: true,
      message: '请输入自定义路径',
      trigger: ['blur', 'change']
    }
  ],
  'dump.featureParams.phone': [
    {
      required: true,
      message: '请输入手机号',
      trigger: ['blur', 'change']
    }
  ]
}

function uuid() {
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
    var r = Math.random() * 16 | 0,
      v = c == 'x' ? r : (r & 0x3 | 0x8);
    return v.toString(16);
  });
}

const iconSourceMap = {
  1: {
    icon: 'business/20220719/0d3df601-6293-466e-8ae9-a5a936be964a.png',
    path: '/sp-member/pages/myOrderList/main',
    path2: '/code-order/pages/myOrderList/main'
  },
  2: {
    icon: 'business/20220719/1b5e6b8d-f9ab-4af1-8e98-0bf3db4d8e02.png',
    // path: '/pages/reservationModule/pages/home/main'
  },
  3: {
    icon: 'business/20220719/f0e585cc-68bf-4a14-96e0-766695add1d1.png',
    path: '/pages/inviteRegister/main'
  },
  4: {
    icon: 'business/20220719/b3d6c0c1-0765-4604-a385-5aaf5e6d0207.png',
    path: '/pages/sendCardBuy/main'
  },
  5: {
    icon: 'business/20220719/9f3c4d09-0f87-4aac-8dbc-4bc6f19a8179.png',
    path: '/pages/myIntegral/main'
  },
  6: {
    icon: 'business/20220719/364bfcac-b767-464d-b5c2-edff2a244799.png',
    path: '/pages/memberCardModule/pages/balanceRecharge/main'
  },
  7: {
    icon: 'business/20220719/2d18a3f0-301c-4c41-98b4-7d6717d43a2a.png',
    path: ''
  },
  8: {
    icon: 'business/20220719/948f8206-0da2-4aae-bfb6-868b4e3a1714.png',
    path: '/sp-member/pages/couponCenter/main'
  },
  9: {
    icon: 'business/20220719/197fe766-9739-4402-8c25-3638e5393794.png',
    path: '/sp-member/pages/personSetting/main'
  },
  10: {
    icon: 'business/20220719/23885927-cd38-47ee-b77d-baad3601da9e.png',
    path: '/code-order/pages/invoice/main'
  },
  11: {
    icon: 'business/20220719/97d9e661-8b0c-426f-8abc-0d8cb5cb8cda.png',
    path: ''
  }
}

export default {
  options,
  rules,
  uuid,
  iconSourceMap
}
